const { resolve } = require("path");
const htmlWebpackPlugin = require("html-webpack-plugin");

module.exports = {
  //   mode: "development",
  entry: resolve(__dirname, "./src/index.js"),
  output: {
    path: resolve(__dirname, "build"),
    filename: "index.[hash:8].js",
  },
  devtool: "source-map",
  resolveLoader: {
    modules: ["node_modules", resolve(__dirname, "loader")],
  },
  module: {
    rules: [
      //   {
      //     test: /\.tpl/,
      //     use: [
      //       "babel-loader",
      //       {
      //         loader: "tpl-loader",
      //         options: {
      //           log: true,
      //         },
      //       },
      //     ],
      //   },
    ],
  },
  plugins: [
    new htmlWebpackPlugin({
      template: resolve(__dirname, "./index.html"),
    }),
  ],
  devServer: {
    contentBase: "./",
    port: 3333,
  },
};
